$(function(){

$('.level01').on('click',function(){

$(this).next('.level02').slideToggle()
$(this).find('b').toggleClass('rotate0')
$(this).addClass('active').siblings('.level01').removeClass('active')

})

$.ajax({
type:'get',
url:'http://localhost:8080/api/v1/admin/user/info',
headers:{
Authorization:localStorage.getItem('token')
},
success:function(backData){
  
   if(backData.code==200){
$('.user_info>img , .user_center_link img').attr('src',backData.data.userPic)
$('.user_info span').text(`欢迎  小${backData.data.nickname}`)
   }
   else{
       window.location.href='./login.html'
   }

}


})
$('.logout').on('click',function(){
    localStorage.removeItem('token')
    window.location.href='./login.html'
})

})